core: use open(..., O_NOATIME) for reading loose objects
authorColin Walters <walters@verbum.org>
Mon, 24 Sep 2012 11:36:42 +0000 (07:36 -0400)
committerColin Walters <walters@verbum.org>
Mon, 24 Sep 2012 11:36:42 +0000 (07:36 -0400)
More efficient, and atime shouldn't matter for these.

src/libostree/ostree-core.c
src/libostree/ostree-repo.c

index 2906da186891f1af4d4162570caafad170549a70..ac9bc2e64d54c2f5bd6d77eec3dcc0e25f6e653a 100644 (file)
@@ -516,7 +516,7 @@ ostree_content_file_parse (GFile                  *content_path,
   ot_lobj GFileInfo *ret_file_info = NULL;
   ot_lvariant GVariant *ret_xattrs = NULL;
 
-  file_input = (GInputStream*)g_file_read (content_path, cancellable, error);
+  file_input = (GInputStream*)gs_file_read_noatime (content_path, cancellable, error);
   if (!file_input)
     goto out;
 
index 2d2f81defd8c3f9df36488584ce5a8270bf0bbd9..44f0905b5b6ba83d8d5f3e0ec8b39f52773923ad 100644 (file)
@@ -2576,7 +2576,7 @@ ostree_repo_load_file (OstreeRepo         *self,
 
                 if (out_input)
                   {
-                    ret_input = (GInputStream*)g_file_read (archive_content_path, cancellable, error);
+                    ret_input = (GInputStream*)gs_file_read_noatime (archive_content_path, cancellable, error);
                     if (!ret_input)
                       goto out;
                   }
@@ -2590,7 +2590,7 @@ ostree_repo_load_file (OstreeRepo         *self,
             ot_lobj GInputStream *uncomp_input = NULL;
             guint64 uncompressed_len;
 
-            file_in = (GInputStream*)g_file_read (loose_path, cancellable, error);
+            file_in = (GInputStream*)gs_file_read_noatime (loose_path, cancellable, error);
             if (!file_in)
               goto out;
 
@@ -2621,7 +2621,7 @@ ostree_repo_load_file (OstreeRepo         *self,
 
             if (out_input && g_file_info_get_file_type (ret_file_info) == G_FILE_TYPE_REGULAR)
               {
-                ret_input = (GInputStream*) g_file_read (loose_path, cancellable, error);
+                ret_input = (GInputStream*) gs_file_read_noatime (loose_path, cancellable, error);
                 if (!ret_input)
                   {
                     g_prefix_error (error, "Error opening loose file object %s: ", ot_gfile_get_path_cached (loose_path));